package com.shujia.MapReduce;


import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Demo9NodeManager {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        // 启动Socket Server 监听8888端口
        ServerSocket socket = new ServerSocket(8888);
        // 接收
        Socket accept = socket.accept();

        // 将输入流转成ObjectInputStream
        ObjectInputStream objectInputStream = new ObjectInputStream(accept.getInputStream());
        // 接收传过来的Task对象
        Object taskObj = objectInputStream.readObject();

        // 强制转换成Task对象
        Task task = (Task) taskObj;
        // 运行
        task.start();


    }
}
